IDs and CLASSES (really basic)

id is the name of the element and it should not be repeated. Behaviour is undefined although modern behaviours are designed to be tolerant to such stupidities.

As HTML and CSS are designed to be very fault tolerant, most browsers will in fact apply the specified styles to all elements given the same id. However, this is considered bad practice as it defies the W3C spec.

    Applying the same id to multiple elements is invalid HTML and should be avoided.

Ids are used to target specific elements using javascript

This is a div named mainBox and is part of the redBg class and the Border class. Although it is confusing cuz I have set mainBox to be an inline element specifically in the CSS.


This a span with the same redBg class

Some emmet things copied from the tutorial source

First Second Third Fourth